<?php

namespace common\models;

use Yii;
use yii\base\Model;
use yii\data\ActiveDataProvider;
use common\models\OrgTree;

/**
 * OrgTreeSearch represents the model behind the search form about `common\models\OrgTree`.
 */
class OrgTreeSearch extends DepartmentSearch
{
//    /**
//     * @inheritdoc
//     */
//    public function rules()
//    {
//        return [
//            [['id', 'parent_id', 'qywx_id', 'parent_qywx_id', 'qywx_order', 'hr_status', 'mdm_id', 'parent_mdm_id', 'mdm_status', 'root', 'lft', 'rgt', 'lvl', 'icon_type', 'active', 'selected', 'disabled', 'readonly', 'visible', 'collapsed', 'movable_u', 'movable_d', 'movable_l', 'movable_r', 'removable', 'removable_all'], 'integer'],
//            [['name', 'number', 'display_name', 'parent_number', 'qywx_name', 'memo', 'hr_id', 'kd_id', 'parent_kd_id', 'created_by', 'created_at', 'updated_by', 'updated_at', 'icon'], 'safe'],
//        ];
//    }
//
//    /**
//     * @inheritdoc
//     */
//    public function scenarios()
//    {
//        // bypass scenarios() implementation in the parent class
//        return Model::scenarios();
//    }
//
//    /**
//     * Creates data provider instance with search query applied
//     *
//     * @param array $params
//     *
//     * @return ActiveDataProvider
//     */
//    public function search($params)
//    {
//        $query = OrgTree::find();
//
//        // add conditions that should always apply here
//
//        $dataProvider = new ActiveDataProvider([
//            'query' => $query,
//        ]);
//
//        $this->load($params);
//
//        if (!$this->validate()) {
//            // uncomment the following line if you do not want to return any records when validation fails
//            // $query->where('0=1');
//            return $dataProvider;
//        }
//
//        // grid filtering conditions
//        $query->andFilterWhere([
//            'id' => $this->id,
//            'parent_id' => $this->parent_id,
//            'qywx_id' => $this->qywx_id,
//            'parent_qywx_id' => $this->parent_qywx_id,
//            'qywx_order' => $this->qywx_order,
//            'hr_status' => $this->hr_status,
//            'mdm_id' => $this->mdm_id,
//            'parent_mdm_id' => $this->parent_mdm_id,
//            'mdm_status' => $this->mdm_status,
//            'created_at' => $this->created_at,
//            'updated_at' => $this->updated_at,
//            'root' => $this->root,
//            'lft' => $this->lft,
//            'rgt' => $this->rgt,
//            'lvl' => $this->lvl,
//            'icon_type' => $this->icon_type,
//            'active' => $this->active,
//            'selected' => $this->selected,
//            'disabled' => $this->disabled,
//            'readonly' => $this->readonly,
//            'visible' => $this->visible,
//            'collapsed' => $this->collapsed,
//            'movable_u' => $this->movable_u,
//            'movable_d' => $this->movable_d,
//            'movable_l' => $this->movable_l,
//            'movable_r' => $this->movable_r,
//            'removable' => $this->removable,
//            'removable_all' => $this->removable_all,
//        ]);
//
//        $query->andFilterWhere(['like', 'name', $this->name])
//            ->andFilterWhere(['like', 'number', $this->number])
//            ->andFilterWhere(['like', 'display_name', $this->display_name])
//            ->andFilterWhere(['like', 'parent_number', $this->parent_number])
//            ->andFilterWhere(['like', 'qywx_name', $this->qywx_name])
//            ->andFilterWhere(['like', 'memo', $this->memo])
//            ->andFilterWhere(['like', 'hr_id', $this->hr_id])
//            ->andFilterWhere(['like', 'kd_id', $this->kd_id])
//            ->andFilterWhere(['like', 'parent_kd_id', $this->parent_kd_id])
//            ->andFilterWhere(['like', 'created_by', $this->created_by])
//            ->andFilterWhere(['like', 'updated_by', $this->updated_by])
//            ->andFilterWhere(['like', 'icon', $this->icon]);
//
//        return $dataProvider;
//    }
}
